#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
许可证模板文件
提供创建各种开源许可证的模板
"""

def get_cc_by_4_0_license(project_name, year, author):
    """
    获取知识共享署名 4.0 国际许可证 (CC BY 4.0) 的模板
    
    Args:
        project_name: 项目名称
        year: 版权年份
        author: 作者名称
        
    Returns:
        str: 格式化后的许可证文本
    """
    return f"""# {project_name} - CC BY 4.0 License

Copyright (c) {year} {author}

This work is licensed under the Creative Commons Attribution 4.0 International License.

To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

## You are free to:

* **Share** — copy and redistribute the material in any medium or format
* **Adapt** — remix, transform, and build upon the material for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

## Under the following terms:

* **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. 
  You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

* **No additional restrictions** — You may not apply legal terms or technological measures that legally restrict others 
  from doing anything the license permits.

## Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use 
is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use. 
For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
"""

def get_cc_by_sa_4_0_license(project_name, year, author):
    """
    获取知识共享署名-相同方式共享 4.0 国际许可证 (CC BY-SA 4.0) 的模板
    
    Args:
        project_name: 项目名称
        year: 版权年份
        author: 作者名称
        
    Returns:
        str: 格式化后的许可证文本
    """
    return f"""# {project_name} - CC BY-SA 4.0 License

Copyright (c) {year} {author}

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

## You are free to:

* **Share** — copy and redistribute the material in any medium or format
* **Adapt** — remix, transform, and build upon the material for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

## Under the following terms:

* **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

* **ShareAlike** — If you remix, transform, or build upon the material, you must distribute your contributions under
  the same license as the original.

* **No additional restrictions** — You may not apply legal terms or technological measures that legally restrict others
  from doing anything the license permits.

## Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use
is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use.
For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
"""

def get_cc_by_nc_4_0_license(project_name, year, author):
    """
    获取知识共享署名-非商业性使用 4.0 国际许可证 (CC BY-NC 4.0) 的模板
    
    Args:
        project_name: 项目名称
        year: 版权年份
        author: 作者名称
        
    Returns:
        str: 格式化后的许可证文本
    """
    return f"""# {project_name} - CC BY-NC 4.0 License

Copyright (c) {year} {author}

This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

## You are free to:

* **Share** — copy and redistribute the material in any medium or format
* **Adapt** — remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.

## Under the following terms:

* **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

* **NonCommercial** — You may not use the material for commercial purposes.

* **No additional restrictions** — You may not apply legal terms or technological measures that legally restrict others
  from doing anything the license permits.

## Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use
is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use.
For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
"""

def get_cc_by_nc_sa_4_0_license(project_name, year, author):
    """
    获取知识共享署名-非商业性使用-相同方式共享 4.0 国际许可证 (CC BY-NC-SA 4.0) 的模板
    
    Args:
        project_name: 项目名称
        year: 版权年份
        author: 作者名称
        
    Returns:
        str: 格式化后的许可证文本
    """
    return f"""# {project_name} - CC BY-NC-SA 4.0 License

Copyright (c) {year} {author}

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

## You are free to:

* **Share** — copy and redistribute the material in any medium or format
* **Adapt** — remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.

## Under the following terms:

* **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

* **NonCommercial** — You may not use the material for commercial purposes.

* **ShareAlike** — If you remix, transform, or build upon the material, you must distribute your contributions under
  the same license as the original.

* **No additional restrictions** — You may not apply legal terms or technological measures that legally restrict others
  from doing anything the license permits.

## Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use
is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use.
For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
""" 